﻿@model RoyaleLiving.Models.DomainModels.IncomeExpenseDetails
@{
    ViewBag.Title = "Royale Living";
}

 @Styles.Render("~/Content/css")

<link href="~/Content/slick.grid.css" rel="stylesheet" />
<script src="~/Scripts/SlickGrid/jquery.event.drag-2.2.js"></script>
<script src="~/Scripts/SlickGrid/slick.core.js"></script>
<script src="~/Scripts/SlickGrid/slick.grid.js"></script>
<script src="~/Scripts/GridData.js"></script>

@section featured {
    <section class="featured">
        <div class="content-wrapper">
            <hgroup class="title">
                <h1>@ViewBag.Title </h1>
                <h3>Income & Expense Details</h3>
            </hgroup>
        </div>
    </section>
}

<div id="detailsDiv">

    @{
        var gridView = new WebGrid(rowsPerPage: Model.PageSize, ajaxUpdateContainerId: "detailsDiv");
        


        gridView.Bind(Model.IncomeExpenseRows, rowCount: Model.TotalRows, autoSortAndPage: false);
        gridView.PageIndex = Model.CurrentPage;
             
    }



    @gridView.GetHtml(columns:gridView.Columns(
            gridView .Column("IncomeExpense", header:"Income/ Expense       "),
            gridView .Column("TransactionDate", header:"Transaction Date        "),
            gridView .Column("TransactionAmount", header:"Amount        "),
            gridView .Column("TransactionMode", header:"Mode        "),
            gridView .Column("TransactionHeadDetails", header:"Head     "),
            gridView .Column("ChequeDetails", header:"Cheque Details        "),
            gridView .Column("CurrentBalance", header:"Current Balance      "),
            gridView .Column("Narration", header:"Narration")
            )
            
            ,alternatingRowStyle:"evenGridRow"
            
          
            )

</div>

@section Scripts {
    @Scripts.Render("~/bundles/jqueryval")
}

<script type="text/javascript">
    $(document).ready(function () {
        $("#detailsDiv a").live('click', function (event) {
            event.preventDefault();
            var href = $(this).attr("href");
            var queryString = href.substring(href.indexOf('?'), href.length);
            var requestUrl = '@Url.Action("IncomeExpenseSummary")' + queryString;
            $("#detailsDiv").load(requestUrl);
        });
    });
</script>



